const app = getApp()
Page({
  data: {
    expert: null,
	sessionFrom:''
  },
  onLoad: function(options) {
    const expertId = parseInt(options.id);
	var that = this		
	app.util.getUserInfo(function (response) {
	    that.setData({
	        userInfo: response
	    });
	    app.mdInit(function (cfg,mine,area) {
	        that.setData({
				cfg: cfg,
				mine:mine,
				area:area
	        });	 
			let content = '';
			if(mine['is_vip'] == 1){
				content = `当前用户是家庭医生会员，有效期：`+mine['expire_time']+`,请提供优质服务`
			}else{
				content = `当前用户是非会员。可向其介绍会员权益进行转化。`
			}
			self.setData({
				sessionFrom: content
			})
			setTimeout(() => {
			  self.selectComponent('#hidden-contact-btn').triggerEvent('tap');
			}, 100);
	    });
	});
	app.util.request({
		url: 'special/detail',
		data: {
			id: expertId
		},
		success(res) {		
			var data = res.data.data;
			var list = data.special
			that.setData({
				expert: list
			});
		}
	})
  }
});